package com.youi.entity;

import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.youi.common.DelStatus;
import com.youi.third.yibaopay.model.Refundresult;

import java.io.Serializable;


/**
 * 易宝退款流水信息
 * @author XJY
 */
public class Yibaorefund implements Serializable {

	private Long id;							//ID
	private Date gmtCreated;					//创建时间
	private Integer delStatus;					//删除状态（0否 1是）
	private Date gmtModify;					    //最后修改时间
	private String status;					    //退款状态
	private String orderId;					    //易宝商户订单号
	private String orderNo;						//需退款的订单号
	private String uniqueOrderNo;			    //易宝流水号
	private String refundOrderNo;			    //退款订单号
	private String uniqueRefundNo;			    //易宝退款流水号
	private String refundAmount;			    //退款金额
	private String residualAmount;			    //剩余金额
	private String refundRequestDate;		    //退款请求日期

    public Yibaorefund(){

    }

    public Yibaorefund(Long id,Date gmtCreated,Integer delStatus,Date gmtModify) {
       this.id=id;
       this.gmtCreated=gmtCreated;
       this.delStatus=delStatus;
       this.gmtModify=gmtModify;
    }


    public Yibaorefund(String orderNo,String status,String uniqueOrderNo,String refundOrderNo,String uniqueRefundNo,String refundAmount,String residualAmount,String refundRequestDate) {
       this.gmtCreated=new Date();
       this.delStatus=DelStatus.NODEL;
       this.gmtModify=gmtCreated;
       this.orderNo=orderNo;
       this.status=status;
       this.uniqueOrderNo=uniqueOrderNo;
       this.refundOrderNo=refundOrderNo;
       this.uniqueRefundNo=uniqueRefundNo;
       this.refundAmount=refundAmount;
       this.residualAmount=residualAmount;
       this.refundRequestDate=refundRequestDate;
    }
    
    public Yibaorefund(Refundresult refundresult,Yibaopayment yibaopayment,String orderNo) {
    	this.gmtCreated=new Date();
        this.delStatus=DelStatus.NODEL;
        this.gmtModify=gmtCreated;
        this.orderId=refundresult.getOrderId();
        this.orderNo=orderNo;
        this.status=refundresult.getStatus();
        this.uniqueOrderNo=yibaopayment.getPaymentNo();
        this.refundOrderNo=refundresult.getRefundRequestId();
        this.uniqueRefundNo=refundresult.getUniqueRefundNo();
        this.refundAmount=refundresult.getRefundAmount();
        this.residualAmount=refundresult.getResidualAmount();
        this.refundRequestDate=refundresult.getRefundRequestDate();
     }
    
    public Yibaorefund(JSONObject data,Yibaopayment yibaopayment,String orderNo) {
    	this.gmtCreated=new Date();
        this.delStatus=DelStatus.NODEL;
        this.gmtModify=gmtCreated;
        this.orderId=data.getString("orderId");
        this.orderNo=orderNo;
        this.status=data.getString("status");
        this.uniqueOrderNo=yibaopayment.getPaymentNo();
        this.refundOrderNo=data.getString("refundRequestId");
        this.uniqueRefundNo=data.getString("refundRequestId");
        this.refundAmount=data.getString("refundAmount");
        this.residualAmount=data.getString("residualAmount");
        this.refundRequestDate=data.getString("refundRequestDate");
     }
    


	public void setId(Long id){
		this.id=id;
	}

	public Long getId(){
		return id;
	}

	public void setGmtCreated(Date gmtCreated){
		this.gmtCreated=gmtCreated;
	}

	public Date getGmtCreated(){
		return gmtCreated;
	}

	public void setDelStatus(Integer delStatus){
		this.delStatus=delStatus;
	}

	public Integer getDelStatus(){
		return delStatus;
	}

	public void setGmtModify(Date gmtModify){
		this.gmtModify=gmtModify;
	}

	public Date getGmtModify(){
		return gmtModify;
	}

	public void setStatus(String status){
		this.status=status;
	}

	public String getStatus(){
		return status;
	}

	public void setOrderNo(String orderNo){
		this.orderNo=orderNo;
	}

	public String getOrderNo(){
		return orderNo;
	}

	public void setUniqueOrderNo(String uniqueOrderNo){
		this.uniqueOrderNo=uniqueOrderNo;
	}

	public String getUniqueOrderNo(){
		return uniqueOrderNo;
	}

	public void setRefundOrderNo(String refundOrderNo){
		this.refundOrderNo=refundOrderNo;
	}

	public String getRefundOrderNo(){
		return refundOrderNo;
	}

	public void setUniqueRefundNo(String uniqueRefundNo){
		this.uniqueRefundNo=uniqueRefundNo;
	}

	public String getUniqueRefundNo(){
		return uniqueRefundNo;
	}

	public void setRefundAmount(String refundAmount){
		this.refundAmount=refundAmount;
	}

	public String getRefundAmount(){
		return refundAmount;
	}

	public void setResidualAmount(String residualAmount){
		this.residualAmount=residualAmount;
	}

	public String getResidualAmount(){
		return residualAmount;
	}

	public void setRefundRequestDate(String refundRequestDate){
		this.refundRequestDate=refundRequestDate;
	}

	public String getRefundRequestDate(){
		return refundRequestDate;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

}
